﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Mapping.aspx.vb" Inherits="BBI_FE_Mapping._Mapping" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>

    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>
    Mapping
    </title>
    <link type="text/css" rel="stylesheet" href="..\css\style.css" />

</head>
<body>
    <form id="form1" runat="server">
      <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server">
    </ajaxToolkit:ToolkitScriptManager>

<asp:UpdatePanel runat="server" ID="updpnlacc">
<ContentTemplate>
    <ajaxToolkit:Accordion
    ID="MyAccordion"
    runat="Server"
    SelectedIndex="0"
    HeaderCssClass="accordionHeader"
    HeaderSelectedCssClass="accordionHeaderSelected"
    ContentCssClass="accordionContent"
    AutoSize="None"
    FadeTransitions="true"
    TransitionDuration="250"
    FramesPerSecond="40"
    RequireOpenedPane="true"
    SuppressHeaderPostbacks="false"
    EnableViewState="true"
    
    >
    <Panes>
        <ajaxToolkit:AccordionPane runat="server" ID="AccPnlTp" >
            <Header> 
            <asp:Panel ID="pnlHeaderTP" 
            runat="server" 
            Height="20px"
              > 
            <div style="padding:5px; cursor: pointer; vertical-align: middle;">
                <div style="float: left;margin-left: 20px;" >
                    <asp:Label ID="lblMapping" runat="server" Text="TIPO MAPPING" CssClass="classHeaderLabel" />
                </div>
                <div style="float: left; margin-left: 20px;">
                    <asp:Label ID="lblTipoMapping" runat="server" Text="..." />
                </div>
                <div style="float: right; vertical-align: middle;">
                    <asp:ImageButton ID="Imagecptp" runat="server" ImageUrl="~/App_Themes/expand_blue.jpg" 
                        AlternateText="(...)" 
                        />
                </div>
            </div>
            </asp:Panel>
            </Header>



            <Content> 
                    <asp:GridView ID="gvMap" runat="server" 
                        AutoGenerateColumns="False" 
                        DataSourceID="dsElencoTypeMapping"
                          DataKeyNames="ID_TYPE_MAPPING"
                           CssClass="mGridTP"
                           >
                        
                        
                        <Columns>
                            <asp:CommandField ButtonType="Image" 
                                SelectImageUrl="~/App_Themes/checked.gif" SelectText="s"  
                                ShowCancelButton="False"  ShowSelectButton="True" 
                                 />
                            <asp:BoundField DataField="ID_TYPE_MAPPING" HeaderText="TYPE MAPPING" 
                                SortExpression="ID_TYPE_MAPPING"  Visible="false" />
                            <asp:BoundField DataField="ID_TYPE_OF_MAPPING" HeaderText="TYPE OF MAPPING" 
                                SortExpression="ID_TYPE_OF_MAPPING" Visible="false" 
                                />
                            <asp:BoundField DataField="DESCR_TYPE_OF_MAPPING" 
                                HeaderText="Descr Type of Mapping"  
                                />
                            <asp:BoundField DataField="DESCR_TYPE_MAPPING" 
                                HeaderText="Type of Mapping" 
                                
                                 />
                        </Columns>

                    </asp:GridView>
                    <asp:ObjectDataSource 
                        ID="dsElencoTypeMapping" runat="server" 
                        OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="GetData" 
                        TypeName="bbi_fe_mapping.MapDatasetTableAdapters.ElencoTypeMappingTableAdapter"
                    >
                    </asp:ObjectDataSource>


            </Content>
            
        </ajaxToolkit:AccordionPane>        
        <ajaxToolkit:AccordionPane runat="server" ID="AccPnlFiltri">
        <Header>
            <asp:Panel 
        ID="pnlExpandCollapseElencoFiltri" 
        runat="server" Height="20px"
        > 
        <div style="padding:5px; cursor: pointer; vertical-align: middle;">
        <div style="float: left;margin-left: 60px;" >
            <asp:Label ID="lblFiltriHeader" runat="server" Text="SELEZIONE FILTRI" CssClass="classHeaderLabel" />
        </div>

        <div style="float: left; overflow:hidden;  margin-left: 20px;">
            <asp:Label  ID="lblElencoFiltri" runat="server" Text="" />
        </div>
        <div style="float: right; vertical-align: middle;">
            <asp:ImageButton ID="Imagecplv" runat="server" ImageUrl="~/App_Themes/expand_blue.jpg" 
                AlternateText="(...)" 
                />
        </div>
        </div>
        </asp:Panel>

        </Header>
        <Content>
        <table>
        <tr>
        <td>
            <div>
                <asp:Button ID="btnAddFiltri" runat="server" 
                CssClass="btnricerca"
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                Text="Aggiungi Filtri" />

                <asp:Button ID="btnAddFiltri_New" runat="server" 
                CssClass="btnricerca"
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
               Text="Aggiungi Filtri (Nuovi)" />

               <asp:Label ID="lblID" runat="server" Text="ID:" />
               <asp:TextBox ID="txtID" runat="server" Text=""  />
               <asp:Label ID="lblRicercaLibera" runat="server" Text ="Ricerca Libera:" />
               <asp:TextBox ID="txtRicercaLibera" runat="server" Text="" />


               <asp:Button ID="btnFillMapping" runat="server" 
                CssClass="btnricerca"
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
               Text="Fill Mapping" />

               <asp:Button ID="btnNuovoMapping" runat="server" 
                CssClass="btnricerca"
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
               Text="Nuovo Mapping" />




           </div>
            </td>
            </tr>
            <tr>
            <td>
           <div>
           

            <asp:GridView 
            ID="LV_filtri" 
            runat="server" 
            DataSourceID="" 
            AutoGenerateColumns="false"
            DataKeyNames= "Mem_ID"
            CssClass="mGridFiltri"
 
          >

          <EmptyDataTemplate>
          <asp:Label ID="lblEmpty_Filtri" Text="Nessun filtri selezionato" runat="server"></asp:Label>
          </EmptyDataTemplate>
            <Columns>
                <asp:ButtonField ButtonType="Image" CommandName = "CancellaFiltro" ImageUrl="~/App_Themes/CancellaFiltro.gif" HeaderText = "" />
                <asp:BoundField DataField="Prefix" HeaderText="Prefix"  />
                <asp:BoundField DataField="Mem_ID" HeaderText="Mem_ID"  Visible = "false"/>
                <asp:BoundField DataField="Mem_Desc" HeaderText="Mem_Desc" />
            </Columns>
        </asp:GridView>
      
       </div>
            </td>
            </tr>
       </table>

        </Content>
        </ajaxToolkit:AccordionPane>
                



        <ajaxToolkit:AccordionPane runat="server" ID="AccPnlGrigliaMap">
        
        <Header>
        <asp:Panel 
        ID="Panel1" 
        runat="server" 
        Height="30px" > 
        <div style="padding:5px; cursor: pointer; vertical-align: middle;">
        <div style="float: left;margin-left: 120px;" >
            <asp:Label ID="Label1" runat="server" Text="MAPPING" CssClass="classHeaderLabel" />
        </div>
        <div style="float: left; margin-left: 20px;">
            <asp:Label ID="lblMappingEstraibiliDesc" runat="server" 
                Text="Mapping Estraibili : "></asp:Label>
            <asp:Label ID="lblMappingEstraibiliCount" runat="server" 
                Text="Selezionare filtri"></asp:Label>
        </div>
        <div style="float: right; vertical-align: middle;">
            <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/App_Themes/expand_blue.jpg" 
                AlternateText="(...)" 
                />
        </div>
        </div>
        </asp:Panel>

  
        </Header>

        <Content>

                <asp:GridView ID="LV_Mapping" runat="server"  
            AutoGenerateColumns="False"  
            GridLines="Both" 
            EnableViewState="true"
            CssClass="mGrid"
            PagerStyle-CssClass="pgr"
            AlternatingRowStyle-CssClass="alt"
            DataKeyNames="id_mapping"

        >
       
        <Columns>
                
            <asp:ButtonField   CommandName="Edit"  ItemStyle-Wrap="true"  ImageUrl="~/App_Themes/pencil.png"  ButtonType="Image"/>
            <asp:ButtonField   CommandName="Cancel" ItemStyle-Wrap="true" ButtonType="Image"  ImageUrl="~/App_Themes/goto.png" Visible="false"/>
            <asp:ButtonField   CommandName="Save"    ItemStyle-Wrap="true" ButtonType="Image" ImageUrl="~/App_Themes/save.png" Visible="false"/>
            <asp:ButtonField   ImageUrl="~/App_Themes/DeleteRiga.gif" ItemStyle-Wrap="true" ButtonType="Image" CommandName="Delete"  text="Delete" />

            <asp:TemplateField HeaderText = "id"  Visible = "true" >
                <ItemTemplate>            
                     <asp:Label ID="id_mappingLabel" runat="server" Text='<%# Eval("id_mapping") %>' />
                </ItemTemplate>
                <EditItemTemplate>            
                     <asp:Label ID="id_mappingLabel" runat="server" Text='<%# Eval("id_mapping") %>' />
                </EditItemTemplate>
            </asp:TemplateField>
           
            <asp:TemplateField>
                <ItemTemplate>       
            <asp:ListView ID="SOURCE_1" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_1">
            <ItemTemplate>
            <tr style="">
                <td>
                    <asp:Label ID="value_sourceLabel" runat="server"  
                        Text='<%# Eval("DESCR_ROW") %>' />
                </td>
            </tr>
            </ItemTemplate>
            <LayoutTemplate>
            <table id="Table2" runat="server" >
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server"  >
                        <table ID="itemPlaceholderContainer"   runat="server" border="0" >
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server" >
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr3" runat="server">
                    <td id="Td2" runat="server" style="">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>
     <!--1 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" 
        SelectCommand='<%# get_SqlDS_SOURCE(1) %>' 
>
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--1 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--1 FINE SOURCE 1-->

            </ItemTemplate>

            <EditItemTemplate>
            <asp:ListView ID="SOURCE_1" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_1">
            <EmptyDataTemplate>
            <table id="Table1" runat="server" style="">
                <tr><td>
                <asp:Button 
                ID="btn_aggiung_1" 
                Text="Add" 
                runat="server"  
                CommandName="AddColRow" 
                CommandArgument="1" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
            </table>
            </EmptyDataTemplate>

            
            <LayoutTemplate>
            <table id="Table2" runat="server">
                
                <tr><td>
                <asp:Button ID="btn_aggiung_1" Text="Add" runat="server"  CommandName="AddColRow" CommandArgument="1" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
                
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

        </LayoutTemplate>

            <ItemTemplate>
                <tr style="" >
                    <td><asp:ImageButton  CommandName="DelRowCol_1" CommandArgument='<%# Eval("VALUE_SOURCE") %>' ImageUrl="~/App_Themes/CancellaRowColMap.gif" runat="server" ID="btnEliminaRowMap_1" /></td>
                    <td><asp:Label ID="value_sourceLabel" runat="server" Text='<%# Eval("DESCR_ROW") %>'   cssClass='<%# getCssClassSource(Eval("stato")) %>'  /></td>
                    <td><asp:Image  ToolTip='<%# Eval("DescrCheck") %>' Visible='<%# GetVisibleCheck(Eval("CheckStato")) %>' ImageUrl="~/App_Themes/CheckStatoDuplicato.jpg" runat="server" ID="ImageButton2" /></td>
                </tr>
            </ItemTemplate>
 

    </asp:ListView>
     <!--1 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" SelectCommand="SELECT DESCR_ROW , VALUE_SOURCE
FROM [BBI_MAPPING].[BwAppMap].[v_ElencoRowSourceMap_1]
where id_mapping = @id_mapping ">
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--1 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--1 FINE SOURCE 1-->

            </EditItemTemplate>


            </asp:TemplateField>

                       
            <asp:TemplateField>
                <ItemTemplate>       
            <asp:ListView ID="SOURCE_2" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_2">
            <ItemTemplate>
            <tr style="">
                <td>
                    <asp:Label ID="value_sourceLabel" runat="server"  
                        Text='<%# Eval("DESCR_ROW") %>' />
                </td>
            </tr>
            </ItemTemplate>
            <LayoutTemplate>
            <table id="Table2" runat="server" >
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server"  >
                        <table ID="itemPlaceholderContainer"   runat="server" border="0" >
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server" >
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr3" runat="server">
                    <td id="Td2" runat="server" style="">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>
     <!--2 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" 
        SelectCommand='<%# get_SqlDS_SOURCE(2) %>' 
>
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--2 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--2 FINE SOURCE 2-->

            </ItemTemplate>

            <EditItemTemplate>
            <asp:ListView ID="SOURCE_2" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_2">
            <EmptyDataTemplate>
            <table id="Table1" runat="server" style="">
                <tr><td>
                <asp:Button 
                ID="btn_aggiung_2" 
                Text="Add" 
                runat="server"  
                CommandName="AddColRow" 
                CommandArgument="2" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
            </table>
            </EmptyDataTemplate>

            
            <LayoutTemplate>
            <table id="Table2" runat="server">
                
                <tr><td>
                <asp:Button ID="btn_aggiung_2" Text="Add" runat="server"  CommandName="AddColRow" CommandArgument="2" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
                
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

        </LayoutTemplate>

            <ItemTemplate>
                <tr style="" >
                    <td><asp:ImageButton  CommandName="DelRowCol_2" CommandArgument='<%# Eval("VALUE_SOURCE") %>' ImageUrl="~/App_Themes/CancellaRowColMap.gif" runat="server" ID="btnEliminaRowMap_2" /></td>
                    <td><asp:Label ID="value_sourceLabel" runat="server" Text='<%# Eval("DESCR_ROW") %>'   cssClass='<%# getCssClassSource(Eval("stato")) %>'  /></td>
                    <td><asp:Image  ToolTip='<%# Eval("DescrCheck") %>' Visible='<%# GetVisibleCheck(Eval("CheckStato")) %>' ImageUrl="~/App_Themes/CheckStatoDuplicato.jpg" runat="server" ID="ImageButton2" /></td>
                </tr>
            </ItemTemplate>
 

    </asp:ListView>
     <!--2 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" SelectCommand="SELECT DESCR_ROW , VALUE_SOURCE
FROM [BBI_MAPPING].[BwAppMap].[v_ElencoRowSourceMap_2]
where id_mapping = @id_mapping ">
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--2 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--2 FINE SOURCE 2-->

            </EditItemTemplate>


            </asp:TemplateField>

           
            <asp:TemplateField>
                <ItemTemplate>       
            <asp:ListView ID="SOURCE_3" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_3">
            <ItemTemplate>
            <tr style="">
                <td>
                    <asp:Label ID="value_sourceLabel" runat="server"  
                        Text='<%# Eval("DESCR_ROW") %>' />
                </td>
            </tr>
            </ItemTemplate>
            <LayoutTemplate>
            <table id="Table2" runat="server" >
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server"  >
                        <table ID="itemPlaceholderContainer"   runat="server" border="0" >
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server" >
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr3" runat="server">
                    <td id="Td2" runat="server" style="">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>
     <!--3 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" 
        SelectCommand='<%# get_SqlDS_SOURCE(3) %>' 
>
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--3 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--3 FINE SOURCE 3-->

            </ItemTemplate>

            <EditItemTemplate>
            <asp:ListView ID="SOURCE_3" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_3">
            <EmptyDataTemplate>
            <table id="Table1" runat="server" style="">
                <tr><td>
                <asp:Button 
                ID="btn_aggiung_3" 
                Text="Add" 
                runat="server"  
                CommandName="AddColRow" 
                CommandArgument="3" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
            </table>
            </EmptyDataTemplate>

            
            <LayoutTemplate>
            <table id="Table2" runat="server">
                
                <tr><td>
                <asp:Button ID="btn_aggiung_3" Text="Add" runat="server"  CommandName="AddColRow" CommandArgument="3" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
                
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

        </LayoutTemplate>

            <ItemTemplate>
                <tr style="" >
                    <td><asp:ImageButton  CommandName="DelRowCol_3" CommandArgument='<%# Eval("VALUE_SOURCE") %>' ImageUrl="~/App_Themes/CancellaRowColMap.gif" runat="server" ID="btnEliminaRowMap_3" /></td>
                    <td><asp:Label ID="value_sourceLabel" runat="server" Text='<%# Eval("DESCR_ROW") %>'   cssClass='<%# getCssClassSource(Eval("stato")) %>'  /></td>
                    <td><asp:Image  ToolTip='<%# Eval("DescrCheck") %>' Visible='<%# GetVisibleCheck(Eval("CheckStato")) %>' ImageUrl="~/App_Themes/CheckStatoDuplicato.jpg" runat="server" ID="ImageButton2" /></td>
                </tr>
            </ItemTemplate>
 

    </asp:ListView>
     <!--3 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" SelectCommand="SELECT DESCR_ROW , VALUE_SOURCE
FROM [BBI_MAPPING].[BwAppMap].[v_ElencoRowSourceMap_3]
where id_mapping = @id_mapping ">
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--3 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--3 FINE SOURCE 3-->

            </EditItemTemplate>


            </asp:TemplateField>

                       
            <asp:TemplateField>
                <ItemTemplate>       
            <asp:ListView ID="SOURCE_4" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_4">
            <ItemTemplate>
            <tr style="">
                <td>
                    <asp:Label ID="value_sourceLabel" runat="server"  
                        Text='<%# Eval("DESCR_ROW") %>' />
                </td>
            </tr>
            </ItemTemplate>
            <LayoutTemplate>
            <table id="Table2" runat="server" >
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server"  >
                        <table ID="itemPlaceholderContainer"   runat="server" border="0" >
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server" >
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr3" runat="server">
                    <td id="Td2" runat="server" style="">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>
     <!--4 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" 
        SelectCommand='<%# get_SqlDS_SOURCE(4) %>' 
>
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--4 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--4 FINE SOURCE 4-->

            </ItemTemplate>

            <EditItemTemplate>
            <asp:ListView ID="SOURCE_4" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_4">
            <EmptyDataTemplate>
            <table id="Table1" runat="server" style="">
                <tr><td>
                <asp:Button 
                ID="btn_aggiung_4" 
                Text="Add" 
                runat="server"  
                CommandName="AddColRow" 
                CommandArgument="4" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
            </table>
            </EmptyDataTemplate>

            
            <LayoutTemplate>
            <table id="Table2" runat="server">
                
                <tr><td>
                <asp:Button ID="btn_aggiung_4" Text="Add" runat="server"  CommandName="AddColRow" CommandArgument="4" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
                
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

        </LayoutTemplate>

            <ItemTemplate>
                <tr style="" >
                    <td><asp:ImageButton  CommandName="DelRowCol_4" CommandArgument='<%# Eval("VALUE_SOURCE") %>' ImageUrl="~/App_Themes/CancellaRowColMap.gif" runat="server" ID="btnEliminaRowMap_4" /></td>
                    <td><asp:Label ID="value_sourceLabel" runat="server" Text='<%# Eval("DESCR_ROW") %>'   cssClass='<%# getCssClassSource(Eval("stato")) %>'  /></td>
                    <td><asp:Image  ToolTip='<%# Eval("DescrCheck") %>' Visible='<%# GetVisibleCheck(Eval("CheckStato")) %>' ImageUrl="~/App_Themes/CheckStatoDuplicato.jpg" runat="server" ID="ImageButton2" /></td>
                </tr>
            </ItemTemplate>
 

    </asp:ListView>
     <!--4 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" SelectCommand="SELECT DESCR_ROW , VALUE_SOURCE
FROM [BBI_MAPPING].[BwAppMap].[v_ElencoRowSourceMap_4]
where id_mapping = @id_mapping ">
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--4 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--4 FINE SOURCE 4-->

            </EditItemTemplate>


            </asp:TemplateField>


           
            <asp:TemplateField>
                <ItemTemplate>       
            <asp:ListView ID="SOURCE_5" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_5">
            <ItemTemplate>
            <tr style="">
                <td>
                    <asp:Label ID="value_sourceLabel" runat="server"  
                        Text='<%# Eval("DESCR_ROW") %>' />
                </td>
            </tr>
            </ItemTemplate>
            <LayoutTemplate>
            <table id="Table2" runat="server" >
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server"  >
                        <table ID="itemPlaceholderContainer"   runat="server" border="0" >
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server" >
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr3" runat="server">
                    <td id="Td2" runat="server" style="">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>
     <!--5 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_5" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" 
        SelectCommand='<%# get_SqlDS_SOURCE(5) %>' 
>
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--5 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--5 FINE SOURCE 5-->

            </ItemTemplate>

            <EditItemTemplate>
            <asp:ListView ID="SOURCE_5" 
            runat="server" 
            DataSourceID="SqlDs_SOURCE_5">
            <EmptyDataTemplate>
            <table id="Table1" runat="server" style="">
                <tr><td>
                <asp:Button 
                ID="btn_aggiung_5" 
                Text="Add" 
                runat="server"  
                CommandName="AddColRow" 
                CommandArgument="5" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
            </table>
            </EmptyDataTemplate>

            
            <LayoutTemplate>
            <table id="Table2" runat="server">
                
                <tr><td>
                <asp:Button ID="btn_aggiung_5" Text="Add" runat="server"  CommandName="AddColRow" CommandArgument="5" 
                Width="50px"
                CssClass="btnricerca" 
                onMouseOver="goLite(this.form.name,this.name)"
                onMouseOut="goDim(this.form.name,this.name)"
                />
                </td></tr>
                
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                            <tr id="Tr2" runat="server" style="">
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

        </LayoutTemplate>

            <ItemTemplate>
                <tr style="" >
                    <td><asp:ImageButton  CommandName="DelRowCol_5" CommandArgument='<%# Eval("VALUE_SOURCE") %>' ImageUrl="~/App_Themes/CancellaRowColMap.gif" runat="server" ID="btnEliminaRowMap_5" /></td>
                    <td><asp:Label ID="value_sourceLabel" runat="server" Text='<%# Eval("DESCR_ROW") %>'   cssClass='<%# getCssClassSource(Eval("stato")) %>'  /></td>
                    <td><asp:Image  ToolTip='<%# Eval("DescrCheck") %>' Visible='<%# GetVisibleCheck(Eval("CheckStato")) %>' ImageUrl="~/App_Themes/CheckStatoDuplicato.jpg" runat="server" ID="ImageButton2" /></td>
                </tr>
            </ItemTemplate>
 

    </asp:ListView>
     <!--5 INIZIO DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
    <asp:SqlDataSource ID="SqlDS_SOURCE_5" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BBI_MAPPINGConnectionString %>" SelectCommand="SELECT DESCR_ROW , VALUE_SOURCE
FROM [BBI_MAPPING].[BwAppMap].[v_ElencoRowSourceMap_5]
where id_mapping = @id_mapping ">
<SelectParameters>
    <asp:ControlParameter Name="id_mapping" 
      ControlID="id_mappingLabel"
      PropertyName="Text"/>
  </SelectParameters>
  

</asp:SqlDataSource>
    <!--5 FINE DATASOURCE DESCRIZIONE SOURCE IN GRIGLIA-->
<!--5 FINE SOURCE 5-->

            </EditItemTemplate>


            </asp:TemplateField>



            <asp:BoundField ReadOnly="true" DataField="DESC_TARGET" HeaderText="Target" SortExpression="DESC_TARGET" />
        </Columns>
</asp:GridView>


        </Content>


        </ajaxToolkit:AccordionPane>
                



    </Panes>            
    <HeaderTemplate>...</HeaderTemplate>
    <ContentTemplate>...</ContentTemplate>
</ajaxToolkit:Accordion>
  </ContentTemplate>
</asp:UpdatePanel>
     
    <div id="div_cerca">
    <!--- RICERCA inizio -->

    <div><p><br /></p></div>

     <ajaxToolKit:ModalPopupExtender 
    ID="mdlPopup" runat="server" 
    TargetControlID="btnAddFiltri_clientside" 
    PopupControlID="pnlPopup" 
     PopupDragHandleControlID="lblCapionModal"
    BackgroundCssClass="mpBg" 
     DropShadow ="true"
    />

    <asp:ImageButton ID="btnAddFiltri_clientside"  OnClientClick="return false" style="display:none" runat="server" ImageUrl="~/App_Themes/AggiungiFiltri.gif" />
                  
                  
                   <asp:Panel ID="pnlPopup" 
                   width = "630px"
                   runat="server" 
                   CssClass="mp" Style="display:inline"                  
                   
                   > 


    <asp:UpdatePanel ID="UpdPnlPopupCerca" runat="server" >
                    <ContentTemplate>
                <div   style="text-align:center" >
                
                <asp:Panel ID="pnlcercahd" runat="server" CssClass="mpHd">
                <asp:Label  Width="90 %" ID="lblCapionModal"
                 runat="server"
                 />
                
                </asp:Panel>



                     </div>        

                      <div align="left"  >
                        
                        
                        <table>
                        <tr>
                        <td>
                        <asp:Label ID ="lblDimensione" Text ="Dimensione: " runat="server" />
                        
                        </td>
                        <td>
                        <asp:DropDownList ID="cmbDimensioni"  runat="server" DataSourceID="" 
                              DataTextField = "Prefix" DataValueField= "Key"    CssClass="InputText"                      
                         />
                        
                        </td>
                        <td>
                        <asp:Label ID ="lblCerca" Text ="Descr/Codice: " runat="server" />
                        
                        </td>
                        <td style="width:100%">
                        
                        <asp:TextBox ID="txtcerca" runat="server"  Width="100%"  CssClass="InputText" 
                              Height="17px"></asp:TextBox>
                        </td>
                        <td>
                        <asp:ImageButton ID="btnCerca" runat="server" ImageUrl="~/App_Themes/CercaDim.gif" />
                        
                        </td>
                        
                        </tr>
                        </table>

                      </div> 
                      <div>
                      
                      </div>
                  
                   <div><p><br /></p></div>
                <asp:Panel ID="pnlGrigliaElenco"  
                    runat="server" 
                    ScrollBars="Auto" 
                    Width="615px"
                    height="200"
                          >
                <asp:GridView 
                    ID="lv_cerca" 
                    runat="server" 
                    DataSourceID="" 
                    AutoGenerateColumns="false"
                    Width ="100%"
                    
                    DataKeyNames= "Mem_ID" 
                    CssClass="mGrid"
                    PagerStyle-CssClass="pgr"
                    AlternatingRowStyle-CssClass="alt"
                >
                    <Columns>
                    <asp:TemplateField>
                    <ItemTemplate>
                    <asp:CheckBox ID="chkFiltra" runat="server" 
                        Checked="false"    
                        OnCheckedChanged="chkFiltra_CheckedChanged" 
                        AutoPostBack="false"
                          />
                    </ItemTemplate>
                    </asp:TemplateField>
                        <asp:BoundField  DataField="Mem_ID" HeaderText="Mem_ID"  Visible="false" ControlStyle-Width="0" />
                        <asp:BoundField DataField="Descr" HeaderText="Descrizione" />
                        

                    </Columns>

                </asp:GridView>
                </asp:Panel>
                    
                   <div><p><br /></p></div>
                   <table>
                   <tr>
                   <td>
                   <div align="left" >
                   
                    <asp:Label  Text="Elemento ALL non disponibile per questa dimensione" runat="server"  Visible="false" ID = "lblALLNO"></asp:Label>
                        <asp:Button ID="btnElementoAll" runat="server" Text="Seleziona elemento ALL" Width="250px"
                                CssClass="btnricerca" 
                                onMouseOver="goLite(this.form.name,this.name)"
                               onMouseOut="goDim(this.form.name,this.name)"
                                />
                    </div>
                    </td>
                    <td>
                    <div align="right" >
                        <asp:Button ID="btnSeleziona" runat="server" Text="Ok" Width="50px"
                                CssClass="btnricerca" 
                                onMouseOver="goLite(this.form.name,this.name)"
                               onMouseOut="goDim(this.form.name,this.name)"
                                />
                        <asp:Button ID="btnClose" runat="server" Text="Cancel"
                            Width="50px"
                            CssClass="btnricerca" 
                            onMouseOver="goLite(this.form.name,this.name)"
                            onMouseOut="goDim(this.form.name,this.name)"
                                />
                    </div>
                   </td>
                   </tr>
                   </table>
                    </div>             


            </ContentTemplate>
            </asp:UpdatePanel>
    
    </asp:Panel>

           
    </div>

 

 
<asp:UpdatePanel ID="udpMsj" runat="server" UpdateMode="Conditional" RenderMode="Inline">
    <ContentTemplate>
        <asp:Button ID="btnD" runat="server" Text="" Style="display: none" Width="0" Height="0" />
        <asp:Button ID="btnD2" runat="server" Text="" Style="display: none" Width="0" Height="0" />
                <asp:Panel ID="pnlMsg" runat="server" CssClass="mp" Style="display:inline" Width="550px">
            <asp:Panel ID="pnlMsgHD" runat="server" CssClass="mpHd">
                &nbsp;Message
            </asp:Panel>
            <asp:GridView ID="grvMsg" runat="server" ShowHeader="false" Width="100%" AutoGenerateColumns="false">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <table>
                                <tr>
                                    <td>
                                        <asp:Image ID="imgErr" runat="server" ImageUrl="~/App_Themes/default/mpImgs/err.png" 
                                               Visible=' <%# GetIconaVisibile(Eval("MessageType"), enmMessageType.Error)  %>'  />
                                        <asp:Image ID="imgSuc" runat="server" ImageUrl="~/App_Themes/default/mpImgs/suc.png"
                                            Visible=' <%# GetIconaVisibile(Eval("MessageType"),enmMessageType.Success)  %>' />
                                        <asp:Image ID="imgAtt" runat="server" ImageUrl="~/App_Themes/default/mpImgs/att.png"
                                            Visible=' <%# GetIconaVisibile(Eval("MessageType"),enmMessageType.Attention)  %>' />
                                        <asp:Image ID="imgInf" runat="server" ImageUrl="~/App_Themes/default/mpImgs/inf.png"
                                            Visible=' <%# GetIconaVisibile(Eval("MessageType"),enmMessageType.Info)  %>' />


                                    </td>
                                    <td>' <%# Eval("MessageText")%>' </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <div class="mpClose">
                <asp:Button ID="btnPostOK" runat="server" Text="OK" CausesValidation="false"  Visible="false" Width="60px" />
                <asp:Button ID="btnPostCancel" runat="server" Text="Cancel" CausesValidation="false" Visible="false" Width="60px" />
            </div>
        </asp:Panel>

        <ajaxToolkit:ModalPopupExtender 
            ID="mpeMsg" 
            runat="server" 
            TargetControlID="btnD"
            PopupControlID="pnlMsg" 
            PopupDragHandleControlID="pnlMsgHD" 
            BackgroundCssClass="mpBg"
            DropShadow="true" 
            >
        </ajaxToolkit:ModalPopupExtender>
    </ContentTemplate>
</asp:UpdatePanel>

     <!--- RICERCA fine -->
    

 
  
    </form>
</body>
</html>



<script type="text/javascript">

    function goLite(FRM, BTN) {
        //window.document.forms[FRM].elements[BTN].style.backgroundColor = "#CCE8CC";
    }

    function goDim(FRM, BTN) {
        //window.document.forms[FRM].elements[BTN].style.backgroundColor = "#CCDDCC";
    }

</script>
